UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1QHNJaravWwdYkxSkSNuBoexg9OZhUAgSTwDpnoIZkQ='
WHERE
key_id = 'c2ecf9e3de4726260e16aa431351ea6bb192b5e53cab8034d2da95da7d84b49e'
AND (
token = '1QHNJaravWwdYkxSkSNuBoexg9OZhUAgSTwDpnoIZkQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)