UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GOmcj2RzRo2Ly+IsJT0AHmf1nRbW7a9pJ5e9MrlHgk8=' 
WHERE 
  key_id = 'eb511e90e6e6ee50e898579df6d530fa9d7cfc2714ab8b11bd380e16cfe170fa' 
  AND (
    token = 'GOmcj2RzRo2Ly+IsJT0AHmf1nRbW7a9pJ5e9MrlHgk8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028