UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V58yhWLxo0dYbcjGcBuLPfEjJJA/AK6/CPJtir6kysg=' 
WHERE 
  key_id = 'efb65d30aa2b3324cc383f0eaed40d72ec3daa4690f8156141de1dc1e4caa825' 
  AND (
    token = 'V58yhWLxo0dYbcjGcBuLPfEjJJA/AK6/CPJtir6kysg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041