UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k1r76d0zwPqbXDdsrISsLVm2ZdJQPrl4qhZ+WSm5KZA='
WHERE
key_id = 'dc578e0cf8b7c8c6694303ebc60daad2f5d5fddb950b0783c3663c3e9b8d4a21'
AND (
token = 'k1r76d0zwPqbXDdsrISsLVm2ZdJQPrl4qhZ+WSm5KZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)