UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OI81kej//VI0YKYp9qvtP0nRf+PZ/HUBsZMSkkowC8E='
WHERE
key_id = 'c5bc009cedf8d03b7985680c7884911d683f9fe19410b4cb1fdae8e90f2ab619'
AND (
token = 'OI81kej//VI0YKYp9qvtP0nRf+PZ/HUBsZMSkkowC8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)