UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wt0ZkNMd/cSL8zxA0jvTy1nAH5wOu8GKxUmHK7Y3oEk='
WHERE
key_id = '47254f4cd27404e43cf16669116a2ccafbef949219fcf5246be4ae9b9e4dbfb1'
AND (
token = 'Wt0ZkNMd/cSL8zxA0jvTy1nAH5wOu8GKxUmHK7Y3oEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)