UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aFXolSrHbHA3auvtj/V065pG60q1Xii3dcWg0c+l5TM='
WHERE
key_id = '69ed667b2d22588f43582fc2a9a1ff5ed70ded59d5f3785fbe78f9889f56bbe8'
AND (
token = 'aFXolSrHbHA3auvtj/V065pG60q1Xii3dcWg0c+l5TM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)