UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K+1z8Gyw2N+q64wwxb/qgaHFjjfRCVoZwIVBcSBBRoQ=' 
WHERE 
  key_id = 'a00da414e266055d7c3e3ced2c34e6adb48e28b44f5fb36f47b3be71a2ab4c89' 
  AND (
    token = 'K+1z8Gyw2N+q64wwxb/qgaHFjjfRCVoZwIVBcSBBRoQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039