UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/aAQNfxvFeQIKmtCdAe/mhZl1cu/cVG9eGBAWG/NDcQ=' 
WHERE 
  key_id = '284e4658f26907dd42341b6807501b08b7385712f3533ac8d83559dd19c15388' 
  AND (
    token = '/aAQNfxvFeQIKmtCdAe/mhZl1cu/cVG9eGBAWG/NDcQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042