UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GwCThoTwdNC9toS1kkH9zMIInWx81jkYWce7ttZKZTQ='
WHERE
key_id = '4912f10d31730a9f778d76532a20ac0115b7212682ee49ee40620836e370e224'
AND (
token = 'GwCThoTwdNC9toS1kkH9zMIInWx81jkYWce7ttZKZTQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)