UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MlegNah/i8f0g1MCMowmVMaSk7dX1SWzUmYYJZXQ9jw='
WHERE
key_id = '5b762a8baa599d1a2fef1c352801bad9472e54045fe90ba6e4bf2e2748382bfd'
AND (
token = 'MlegNah/i8f0g1MCMowmVMaSk7dX1SWzUmYYJZXQ9jw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)