UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GUqXQugqjZ6UNOlKBG5HD5bVZ4TgCaugrBGbVpvtsqg=' 
WHERE 
  key_id = '93e07115578ed162637d4a10710ca919077e1011138c9bf39213b411bb72e8fd' 
  AND (
    token = 'GUqXQugqjZ6UNOlKBG5HD5bVZ4TgCaugrBGbVpvtsqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040