UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9FjmlKOIWJ6bRDkDXkKNKh6fte0Qf/u6K88Fe8nVMhc='
WHERE
key_id = '475788ef393a7ad34a18e5f4a0d4653df5ee412147d3db6f947ebf1c107c58cd'
AND (
token = '9FjmlKOIWJ6bRDkDXkKNKh6fte0Qf/u6K88Fe8nVMhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)