UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GcEwNZTl/e/1gPoNuXT4ld4fq2xpZqWIL91ndr13sB4='
WHERE
key_id = 'bc30a9fc0e4541b6c8990b7130267a2bc4393479ff8d4e7214506349cdffcbb6'
AND (
token = 'GcEwNZTl/e/1gPoNuXT4ld4fq2xpZqWIL91ndr13sB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)