UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PGr7OsyJ17xjr5KZ8jfRZKnO5LZiqp9lMiXbbvsjHbI=' 
WHERE 
  key_id = '53cda43b22d974e02137bdf1cc72cf310edbc1cd0c706894f89a70f17b574f98' 
  AND (
    token = 'PGr7OsyJ17xjr5KZ8jfRZKnO5LZiqp9lMiXbbvsjHbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035