UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2olZPVLSSn7T0+mQOBD7FrXOCJ2JK3vA21+XqP3D9GI=' 
WHERE 
  key_id = 'ab16fd2df148d0097f1658a0576e0dbebd788487ff93767977d9224a96b9de84' 
  AND (
    token = '2olZPVLSSn7T0+mQOBD7FrXOCJ2JK3vA21+XqP3D9GI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039