UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'keD5ylkRYzZNc7V3HKtv8CwowNUIP8TR73EuUOc6U8c='
WHERE
key_id = '1c6abec8c6cf947f823902984e97ec9efe05f52845c4679b2d046568d9616ca0'
AND (
token = 'keD5ylkRYzZNc7V3HKtv8CwowNUIP8TR73EuUOc6U8c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)