UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Gbzwaw2fQGGlDl3T8mRuzde2YbbWVY4aX6sWMObmSQ='
WHERE
key_id = '0d09ee55a5d22b89afc47f6a2c3f8ec2939bb54ce2fdf8c59283e610e4e19516'
AND (
token = '9Gbzwaw2fQGGlDl3T8mRuzde2YbbWVY4aX6sWMObmSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)