UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zi4D2+EgRXvadtV4jqrlixIK4TmUHabHjRrb/2kkd2o=' 
WHERE 
  key_id = '8acd3ca2234c4a69c4076286ce16129e40383a54ebf069bec283ef4779525b9d' 
  AND (
    token = 'zi4D2+EgRXvadtV4jqrlixIK4TmUHabHjRrb/2kkd2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052