UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DnWwKpwNZj7vc/mcosJJmBxDGSs6It5Pu12Jo45tn4M='
WHERE
key_id = '62a5601f94eb88c8ccd69bdb2e0d307c1d856f0d7ee66b2ea2628fc0c529563f'
AND (
token = 'DnWwKpwNZj7vc/mcosJJmBxDGSs6It5Pu12Jo45tn4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)