UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+tilce0Y2TCsn6Tagjt9KP9FNgp0NQWsM374EH4oIrY=' 
WHERE 
  key_id = 'b92c424eb20ec7eef087122560241dbbdc6233905e7a9a1801b99edf35719e0c' 
  AND (
    token = '+tilce0Y2TCsn6Tagjt9KP9FNgp0NQWsM374EH4oIrY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00096