UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CFvanfJ8rQ2PV2Kjc3sJJQQAIs4J+bRv4ZmX1SN8x7k=' 
WHERE 
  key_id = '5155cdc1a67650dc478e7b634e407ddb4fa4ef037ce705c6f3f9f6c9d947c180' 
  AND (
    token = 'CFvanfJ8rQ2PV2Kjc3sJJQQAIs4J+bRv4ZmX1SN8x7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019