UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1UtlxbWVBU3eLGteYvXt58nJwTeI8YvB83JhP5w/XJs='
WHERE
key_id = 'f576c17f431a6c5400032ac2c2a11fcf25fb42668ae641b0156ebae3c635fb07'
AND (
token = '1UtlxbWVBU3eLGteYvXt58nJwTeI8YvB83JhP5w/XJs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)