UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kMlZw2d5MqoXg+MtM4f8PupcxYBvnN2gWZXjV4QSuFY='
WHERE
key_id = '36aea89583f09c0050b4bbb3e5edd8857cf6614ed592553ccf4f6b027cc63363'
AND (
token = 'kMlZw2d5MqoXg+MtM4f8PupcxYBvnN2gWZXjV4QSuFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)