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