UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qEoCnngebdJ/PkSa5e/Bkn4/HVp5hmD/79YXVhBonu8=' 
WHERE 
  key_id = '66c60cb0cf423365d05e35013c87676a066083fc80754ff582a7e98986c56660' 
  AND (
    token = 'qEoCnngebdJ/PkSa5e/Bkn4/HVp5hmD/79YXVhBonu8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046