UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XVevq9kJqxVu7F55DvgPrHv1bvF9mTcRPkrBxEHtae4='
WHERE
key_id = '8275fe3a538e83987eda2223ca84422558ba84a1ef05381eed107a8d75cd19cb'
AND (
token = 'XVevq9kJqxVu7F55DvgPrHv1bvF9mTcRPkrBxEHtae4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)