UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y1HlnYzkYpE+xzm+WdE2kZw5F6yC7s3el1ArhiWTXMQ='
WHERE
key_id = '14054f1130750dfbbe801438edade31b2440bb3d42a46630a2e5cfb2ce84fae6'
AND (
token = 'Y1HlnYzkYpE+xzm+WdE2kZw5F6yC7s3el1ArhiWTXMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)