UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Plbj+JER+6UQ3oKvq0KkEL39LWUaoU71hilVoclve7Y='
WHERE
key_id = 'f0416f2336669d3b6b5303f68f645ad71ef79ba3817c7cf741e2ee1c4437f961'
AND (
token = 'Plbj+JER+6UQ3oKvq0KkEL39LWUaoU71hilVoclve7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)