UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MwBKMJw9vF7MWzhafWwPzlRbKW8KKuSGiIyomlaLkqY='
WHERE
key_id = 'd55be3ea5f04449ddce88d8b2279b7cf929a206b768579c16067db6c163c1644'
AND (
token = 'MwBKMJw9vF7MWzhafWwPzlRbKW8KKuSGiIyomlaLkqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)