UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cfJmEuAXo1mlSgYlCykR5TUhVa4kbluZu6UamFWiD1E='
WHERE
key_id = 'c5b238f72bff7627c24af19a02fca5388f04b5b799aa203321b7c56aa986d6b4'
AND (
token = 'cfJmEuAXo1mlSgYlCykR5TUhVa4kbluZu6UamFWiD1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)