UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CjZY7sFXwLFyekUiw9j6SMqxE6f1zdl/5DvzYokFqlo=' 
WHERE 
  key_id = '45a93344cd17ddad4c0cf80d1c783645dd252ae3df493914f9f878dbbed54be1' 
  AND (
    token = 'CjZY7sFXwLFyekUiw9j6SMqxE6f1zdl/5DvzYokFqlo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052