UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j+6hrRXgk/WvQRj9hl2pPZCOGXpr0kZXxctTzJFxNLo=' 
WHERE 
  key_id = 'cf057adce915d360e78ec8899fac63b0279e99720297160b6ff10f18adb4355e' 
  AND (
    token = 'j+6hrRXgk/WvQRj9hl2pPZCOGXpr0kZXxctTzJFxNLo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027