UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3jQiAwpSGGT4X8jFv6ui3Z3hkKz7Sd1nLCXbzX8ROws='
WHERE
key_id = '11a5c312bdaeab24af1550b6267eb8fbe0a98d90bd5666435fd1fb28c00cd5ba'
AND (
token = '3jQiAwpSGGT4X8jFv6ui3Z3hkKz7Sd1nLCXbzX8ROws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)