UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KzFJQH8Z602saYwWbq72faI7Rw/rMrCP19/PFH4/nMU='
WHERE
key_id = 'dae8dc4605bab7c2b9b71730e768d591e3e7de02860ecc0733d0a0e9442c99cb'
AND (
token = 'KzFJQH8Z602saYwWbq72faI7Rw/rMrCP19/PFH4/nMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)