UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nTN2xXWA5yVrPSxUihLKh3UGd+NG8TxSOLM1RGoehFQ=' 
WHERE 
  key_id = 'c3b268fab4d0a99641a47dc4a4ca7530ac3782c92bcb26c7339767beb6b5729b' 
  AND (
    token = 'nTN2xXWA5yVrPSxUihLKh3UGd+NG8TxSOLM1RGoehFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029