UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '22oNMn4ljBDxvDxjofhdUYZHeNHRfW9x/1odLC6snBc='
WHERE
key_id = '1005f29c72ab6126c2296d651fcc74853daeab97c09d2f6dfee8ecc1244b6f12'
AND (
token = '22oNMn4ljBDxvDxjofhdUYZHeNHRfW9x/1odLC6snBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)