UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sdiaoxXgrA4oEwlrMJm51unvcTuUBPXPVFKhVB1NJZA=' 
WHERE 
  key_id = '50406718778ccaf5466a55204d6bc9671b42268bcafb0373cb9b99fec26bd5a7' 
  AND (
    token = 'sdiaoxXgrA4oEwlrMJm51unvcTuUBPXPVFKhVB1NJZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022