UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2+HAR+AaMjQdmFJIRnfSckx1oiLan1jwB2jWaxbN4nY=' 
WHERE 
  key_id = 'b6fc011b0ef4ac38835631aa28ee917295f3451b84695e433a02b0cf0ccaf0d7' 
  AND (
    token = '2+HAR+AaMjQdmFJIRnfSckx1oiLan1jwB2jWaxbN4nY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025