UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nizm7KMbdeYqyodwxm8ghA0M5Q7jxe/5/QxSSjryZzk='
WHERE
key_id = 'ba9c9289841100b5116413096af19de73fb76723a370e1ad81a600aa707f3aa5'
AND (
token = 'Nizm7KMbdeYqyodwxm8ghA0M5Q7jxe/5/QxSSjryZzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)