UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+sRQmIs/WAVLIbLzLQPudpiQPYpBd/Ts/eYLQNvd01k=' 
WHERE 
  key_id = '1df259fc67826e19164861716805c0eb15c6493776b92bb01a9ad037fd3490c0' 
  AND (
    token = '+sRQmIs/WAVLIbLzLQPudpiQPYpBd/Ts/eYLQNvd01k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015