UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'POjsnIry2nUTcoc9Pj/z5PqjUxnZilsrnsuTcJROi/U=' 
WHERE 
  key_id = 'd1bbdf86514eff9c84e36770809e64a346f2f33361abdb783088fd76bf17e83f' 
  AND (
    token = 'POjsnIry2nUTcoc9Pj/z5PqjUxnZilsrnsuTcJROi/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026