UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '52HqbeCJG+oEomwJYuXgll+28RkNRt+9OaRLbH59QZ8='
WHERE
key_id = '9cb2a6b606b1fe9c9bb6ae1aa901aca04ace24060fd847c3928683b311a97343'
AND (
token = '52HqbeCJG+oEomwJYuXgll+28RkNRt+9OaRLbH59QZ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)